<template>
  <div class="Language">
    <!-- 点击触发回调事件 -->
    <el-dropdown @command="changeLanguage">
      <span>
        <svg-icon style="color:#fff;font-size:20px" icon-class="language" />
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="cn">中文</el-dropdown-item>
        <el-dropdown-item command="en">English</el-dropdown-item>
        <el-dropdown-item command="ja">にほんご</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>

<script>
export default {
  methods: {
    changeLanguage(arg) {
      this.$i18n.locale = arg
    }
  }
}
</script>

<style lang="scss" scoped>
.Language{
  margin-right: 15px;
  cursor: pointer;
}
</style>
